//api.js
import service from './request'
 
export const getPersonInfo = data => {
    console.log('触发封装的Axios方法！')
    return service({
        url: '/care-server/user/regist',
        method: 'post',
        data
    })
};

//社区管理员注册
export const userRegist = data => {
    console.log('触发封装的Axios方法！')
    return service({
        url: '/care-server/admin/user/manager/save',
        method: 'post',
        data
    })
};

export const AdminLogout = data => {
    return service({
        url: '/care-server/admin/logout',
        method: 'post',
        data
    })
};

export const SaveOrUpdateManager = data => {
    console.log('触发封装的Axios方法！')
    return service({
        url: '/care-server/admin/user/manager/saveOrUpdate',
        method: 'post',
        data
    })
};

//用户登录
export const userLogin = data => {
    return service({
        url: '/care-server/admin/login',
        method: 'post',
        data
    })
};

//更新个人信息
export const updateProfile = data => {
    return service({
        url: '/care-server/admin/updateProfile',
        method: 'post',
        data
    })
};

//管理员更新用户信息
export const AdminUpdateUser = data => {
    return service({
        url: '/care-server/admin/user/update',
        method: 'post',
        data
    })
};

//管理员：更新用户状态
export const AdminUpdateUser2 = data => {
    return service({
        url: '/care-server/admin/user/update2',
        method: 'post',
        data
    })
};

//管理员获取微信用户列表
export const AdminUserList = data => {
    return service({
        url: '/care-server/admin/user/list',
        method: 'post',
        data
    })
};

//管理员获取社区管理员用户列表
export const AdminManagerList = data => {
    return service({
        url: '/care-server/admin/user/manager/list',
        method: 'post',
        data
    })
};

//更新社区管理员状态
export const UpdateMgrStatus = data => {
    return service({
        url: '/care-server/admin/user/manager/update',
        method: 'post',
        data
    })
};

//后台：所有社区列表
export const AllCommunityList = data => {
    return service({
        url: '/care-server/admin/community/list/all',
        method: 'post',
        data
    })
};

//分页查询社区鲭
export const AdminCommunityList = data => {
    return service({
        url: '/care-server/admin/community/list',
        method: 'post',
        data
    })
};

//更新社区信息
export const UpdateCommunity = data => {
    return service({
        url: '/care-server/admin/community/update',
        method: 'post',
        data
    })
};

//管理员登录
export const AdminLogin = data => {
    return service({
        url: '/care-server/admin/login',
        method: 'post',
        data
    })
};

//社区管理员:获取仪表盘数据
export const GetDashboardInfo = data => {
    return service({
        url: '/care-server/admin/community/dashboard/data',
        method: 'get',
        data
    })
};

export const GetServiceList = data => {
    return service({
        url: '/care-server/admin/community/service/list',
        method: 'post',
        data
    })
};

export const CancelServiceStatus = data => {
    return service({
        url: '/care-server/admin/community/service/cancel',
        method: 'post',
        data
    })
};

export const GetInfoList = data => {
    return service({
        url: '/care-server/admin/info/list',
        method: 'post',
        data
    })
};

export const SaveInfo = data => {
    return service({
        url: '/care-server/admin/info/save',
        method: 'post',
        data
    })
};

export const DeleteInfo = data => {
    return service({
        url: '/care-server/admin/info/delete',
        method: 'post',
        data
    })
};

export const AdminForumList = data => {
    return service({
        url: '/care-server/admin/forum/list',
        method: 'post',
        data
    })
};

export const AdminDeleteForum = data => {
    return service({
        url: '/care-server/admin/forum/delete',
        method: 'post',
        data
    })
};

export const MerchantSaveForum = data => {
    return service({
        url: '/care-server/admin/forum/save',
        method: 'post',
        data
    })
};

export const GetForumDetail = data => {
    return service({
        url: '/care-server/admin/forum/detail',
        method: 'post',
        data
    })
};

export const AdminDeleteComment = data => {
    return service({
        url: '/care-server/admin/forum/comment/delete',
        method: 'post',
        data
    })
};

export const updateAdminProfile = data => {
    return service({
        url: '/care-server/admin/updateProfile',
        method: 'post',
        data
    })
};

export const GetSysLogList = data => {
    return service({
        url: '/care-server/admin/log/list',
        method: 'post',
        data
    })
}

export const ConfigList = data => {
    return service({
        url: '/care-server/admin/config/list',
        method: 'post',
        data
    })
};

export const SaveConfig = data => {
    return service({
        url: '/care-server/admin/config/save',
        method: 'post',
        data
    })
};

export const DeleteConfig = data => {
    return service({
        url: '/care-server/admin/config/delete',
        method: 'post',
        data
    })
};

export const UserLoginWxOpenid = data => {
    return service({
        url: '/care-server/admin/user/author/login',
        method: 'post',
        data
    })
};